# 获取ip地址归属地
import requests
import io
import sys
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf-8')

try:
	url = 'http://m.ip138.com/ip.asp?ip='
	r = requests.get(url + '202.204.80.112')
	r.raise_for_status()
	print(r.text[-500:])
except:
	print('获取失败')
